﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace XSTDZ.ERP.WebApp.Models
{
    public class RoleModel
    {
        public IList<Guid> ConvertStringToGuidList(string ids)
        {
            IList<Guid> lst = new List<Guid>(0);
            if (!string.IsNullOrEmpty(ids))
            {
               ids= ids.ToUpper().Replace(XSTDZ.ERP.Infrastructure.SystemConfig.permissionTreeRootId.ToString().ToUpper(), "");
                string[] idArrays = ids.Split(new Char[] { '@' }, StringSplitOptions.RemoveEmptyEntries);
               if (idArrays != null && idArrays.Length > 0)
               {
                   for (int i = 0; i < idArrays.Length; i++)
                   {
                       lst.Add(Guid.Parse(idArrays[i].ToString()));
                   }
               }
            }
            return lst;
        }
    }
}